namespace Maple.Branch.ConsoleGateway.Contorllers
{
    using System.Linq;
    using System.Runtime.InteropServices;
    using Microsoft.AspNetCore.Authorization;
    using Microsoft.AspNetCore.Mvc;

    public class HomeController : Controller
    {
        public IActionResult Index()
        {
            return Ok(new
            {
                RuntimeInformation.OSDescription,
                RuntimeInformation.FrameworkDescription,
                RuntimeInformation.OSArchitecture,
                RuntimeInformation.ProcessArchitecture
            });
        }

        [HttpGet]
        [Authorize]
        public IActionResult Get()
        {
            return Ok(User.Claims.Select(m => new { m.Type, m.Value }));
        }
    }
}
